package com.tmsb.bigscreen.utils;

/**
 * Description: Version:1.0.0
 *
 * @author shihb
 * @date 2020/7/6 16:09
 */
public class NumUtil {

  /**
   * 增加千分位
   * @param str
   * @return
   */
  public static String formatter(String str) {
    if(str==null || "".equals(str.trim())){
      return "0";
    }
    String[] strSS = str.split("\\.");
    String string = strSS[0].replaceAll("(?<=\\d)(?=(?:\\d{3})+$)", ",");
    if(strSS.length>1){
      return string + "." + strSS[1];
    }else {
      return string;
    }

  }


}
